package com.bilibili.util;

import com.bilibili.entity.UserInfo;
import com.bilibili.enumeration.Gender;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

public class ObjectUtil {

    public static UserInfo initUserInfo(Long userId){
        UserInfo userInfo = new UserInfo();
        userInfo.setUserId(userId);
        userInfo.setNickname("默认昵称");
        userInfo.setAvatar("默认头像");
        LocalDateTime defaultBirthday = LocalDateTime.of(1970, 1, 1, 0, 0, 0);
        Date defaultBirthdayDay = Date.from(defaultBirthday.atZone(ZoneId.systemDefault()).toInstant());
        userInfo.setBirthday(defaultBirthdayDay);
        userInfo.setGender(Gender.OTHER.getCode());
        Date now = new Date();
        userInfo.setCreateTime(now);
        userInfo.setUpdateTime(now);
        return userInfo;
    }

}
